package com.liang.controller;

import java.util.LinkedHashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.liang.pojo.OrderItem;
import com.liang.service.OrderItemService;

@Controller
public class OrderItemController {
	/*
	 * @Autowired OrderItemService orderItemService;
	 * 
	 * @RequestMapping("") public String insertOrderItem(OrderItem orderItem) {
	 * Map<String,OrderItem> map=new LinkedHashMap<String,OrderItem>(); String
	 * key=String.valueOf(orderItem.getStore().getId()); if(map.containsKey(key)) {
	 * int oldCount=map.get(key).getCount();
	 * orderItem.setCount(oldCount+orderItem.getCount()); map.put(key, orderItem);
	 * }else { map.put(key, orderItem); } orderItemService.insertOrderItem(map);
	 * 
	 * return null; }
	 * 
	 * @RequestMapping("") public String deleteOrderItemById(@RequestParam("id")int
	 * id) { orderItemService.deleteOrderItemById(id); return null; }
	 * 
	 * @RequestMapping("") public String selectAllOrderItem(@RequestParam("id")int
	 * id) { orderItemService.selectAllOrderItem(id); return null; }
	 * 
	 * @RequestMapping("") public String deleteAllOrderItem(@RequestParam("id")int
	 * id) { orderItemService.deleteAllOrderItem(id); return null; }
	 */
}
